import java.util.*;
public class EX8_8 {
	public static void main(String args[]) {
		String sourceString = "今晚十点进攻";
		EncryptAndDecrypt person = new EncryptAndDecrypt();
		System.out.println("加密内容:"+sourceString);
		Random random = new Random();
		  int i	= (int)(Math.random()*(9999));
		String password = String.valueOf(i);
		String secret = person.encrypt(sourceString,password);
		System.out.println("随机生成的秘钥:"+password);
       System.out.println("密文:"+secret);
       String source = person.decrypt(secret,password);
       System.out.println("明文:"+source);
    }
}

